<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div style="height: 200px; width: 200px; background-color: red;" 
        onmouseover="testOver()" onmouseout="testOut()">

    </div>

    <script>
        function testOver() {
            console.log("鼠标移上事件");
        }
        function testOut() {
            console.log("鼠标移出事件");
        }
    </script>
</body>
</html>